<extend name="Layout:layout_list" />
<block name="body_content_block">
    <table id="main_grid" class="easyui-datagrid" data-url="{:AddonU('SMS/get_sms_send_history_list_json')}"></table>
    <div id="tb" style="padding:2px 5px;">
        <div style="margin-bottom: 5px; border-bottom:solid 1px #dddddd;">
            <a href="{:AddonU('Admin/admin_edit')}" class="easyui-linkbutton lnk_grid_add" iconCls="icon-add" plain="true">新增</a>
            <a href="{:AddonU('Admin/admin_edit','id=varid')}" class="easyui-linkbutton lnk_grid_edit" iconCls="icon-edit" plain="true">编辑</a>
            <a href="{:AddonU('Admin/admin_delete','id=varid')}" class="easyui-linkbutton lnk_grid_remove" iconCls="icon-remove" plain="true" data-prompt-value="zhan123">删除</a>
            <a href="{:AddonU('Admin/admin_export')}" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出</a>
            <a href="#" class="easyui-linkbutton lnk_grid_search" iconCls="icon-search" plain="true">搜索</a>
        </div>
    </div>
    <!--隐藏区域-->
    <div style="display:none">
        <!--表格查询对话框-->
        <div id="dlg_search" style="padding:10px">
            <form method="get" action="{:AddonU('SMS/get_sms_send_history_list_json')}" data-export-url="{:AddonU('Admin/admin_export')}">
                日期 <input name="createdTime" class="easyui-datebox">
                接收号码：<input type="text" name="phoneNumber" class="easyui-textbox" />
                发送状态：<select name="state" title="请选择状态">
                    <option value=''>所有</option>
                    <option value='1'>发送成功</option>
                    <option value='4'>发送失败</option>
                </select>
                <if condition="$isSuperAdmin">
                    租户：<input type="text" name="siteID" id="siteID" class="easyui-combobox" data-url="{:AddonU('Admin/get_admin_json')}" />
                    <else/>
                    <input type="hidden" name="siteID" value="{$loginData.siteID}"/>
                </if>
            </form>
        </div>
        <!--/表格查询对话框-->
    </div>
    <!--/隐藏区域-->
</block>
<block name="body_after_block">
    <script type="text/javascript">
        // 页面初始化
        var curd_grid = CurdGrid.newInstance();
        curd_grid.before_search_dialog = function () {
            $('#siteID').combobox({url: $('#siteID').data('url'), valueField: 'id', textField: 'text'});
        }
        curd_grid.config({
            title: '短信详单管理',
            toolbar: '#tb',
            columns: [[
                    {field: 'ck', checkbox: true},
                    {title: "租户ID", field: "siteID", sortable: true},
                    {title: "接收号码", field: "phoneNumber", sortable: true},
                    {title: "发送状态", field: "stateText", sortable: true},
                    {title: "短信服务器", field: "serverName", sortable: true},
                    {title: "计费条数", field: "smsCount", sortable: true},
                    {title: "计费金额", field: "amount", sortable: true},
                    {title: "发送次数", field: "sendCount", sortable: true},
                    {title: "发送时间", field: "sendTime", sortable: true},
                    {title: "短信签名", field: "sign", sortable: true},
                    {title: "短信内容", field: "message", sortable: true},
                    {title: "编号", field: "id", hidden: true},
                ]],
        });
        curd_grid.init();
    </script>
</block>